/**
 * Copyright (c) 2022 myons Inc. All rights reserved.
 */
package cn.zmwh.common.core.enums;


/**
 * @describe: 验证码内容 、
 * @author: dmzmwh 、
 * @time: 2022-05-26 22:18 、
 */
public enum CodeEnum {

    //如您有任何疑问，请拨打"+Constant.KF_TEL +"联系专属客服。"<span style = 'font-size: 20px;font-weight: bold'>"+smsCode+"</span>"
    LONGIN_REGISTER("login", 15, false, "login:", "【{}】登录验证码：<span style = 'font-size: 20px;font-weight: bold'>{}</span>，{}分钟内有效。为保护账户安全请勿转发，如非本人操作，请忽略本短信。");

    /**
     * 类型
     */
    private String key;
    /**
     * 过期时间 单位分钟
     */
    private Integer time;
    /**
     * 是否从接口同步返回验证码
     */
    private Boolean show;
    /**
     * 文本
     */
    private String content;
    /**
     * 类型标识
     */
    private String sign;

    CodeEnum(String key, Integer time, Boolean show, String sign, String content) {
        this.key = key;
        this.time = time;
        this.show = show;
        this.content = content;
        this.sign = sign;
    }

    public String getKey() {
        return key;
    }

    public Integer getTime() {
        return time;
    }

    public String getSign() {
        return sign;
    }

    public Boolean getShow() {
        return show;
    }

    public String getContent() {
        return content;
    }

    public static CodeEnum getEnumByKey(String key) {
        CodeEnum[] values = values();
        for (CodeEnum value : values) {
            if (value.getKey().equals(key)) {
                return value;
            }
        }
        return null;
    }
}
